
{************************************************************************************}
{                                                                                    }
{                                  XML Data Binding                                  }
{                                                                                    }
{         Generated on: 2008-12-4 17:03:57                                           }
{       Generated from: F:\projects\QueryItSuite\QI.ClientApp\bin\query.client.xml   }
{                                                                                    }
{************************************************************************************}

unit XmlQueryClientConfig;

interface

uses xmldom, XMLDoc, XMLIntf;

type

{ Forward Decls }

  IXMLQueryClientConfigType = interface;
  IXMLPrintersType = interface;
  IXMLReportType = interface;
  IXMLConnected_printersType = interface;
  IXMLPrinterType = interface;

{ IXMLQueryClientConfigType }

  IXMLQueryClientConfigType = interface(IXMLNode)
    ['{96C94840-6AEF-4726-BBAC-2C568B945611}']
    { Property Accessors }
    function Get_Printers: IXMLPrintersType;
    function Get_Connected_printers: IXMLConnected_printersType;
    { Methods & Properties }
    property Printers: IXMLPrintersType read Get_Printers;
    property Connected_printers: IXMLConnected_printersType read Get_Connected_printers;
  end;

{ IXMLPrintersType }

  IXMLPrintersType = interface(IXMLNodeCollection)
    ['{0B464E11-628E-4855-A945-D10D11B3E983}']
    { Property Accessors }
    function Get_Report(Index: Integer): IXMLReportType;
    { Methods & Properties }
    function Add: IXMLReportType;
    function Insert(const Index: Integer): IXMLReportType;
    property Report[Index: Integer]: IXMLReportType read Get_Report; default;
  end;

{ IXMLReportType }

  IXMLReportType = interface(IXMLNode)
    ['{F7923361-D721-4878-9B49-28C46A6B9D5B}']
    { Property Accessors }
    function Get_Hashid: WideString;
    function Get_Printer: WideString;
    procedure Set_Hashid(Value: WideString);
    procedure Set_Printer(Value: WideString);
    { Methods & Properties }
    property Hashid: WideString read Get_Hashid write Set_Hashid;
    property Printer: WideString read Get_Printer write Set_Printer;
  end;

{ IXMLConnected_printersType }

  IXMLConnected_printersType = interface(IXMLNodeCollection)
    ['{4252E681-6021-47F7-A49D-2069395E057B}']
    { Property Accessors }
    function Get_Printer(Index: Integer): IXMLPrinterType;
    { Methods & Properties }
    function Add: IXMLPrinterType;
    function Insert(const Index: Integer): IXMLPrinterType;
    property Printer[Index: Integer]: IXMLPrinterType read Get_Printer; default;
  end;

{ IXMLPrinterType }

  IXMLPrinterType = interface(IXMLNode)
    ['{41ED6165-02DF-4107-B612-CCF6DA7C28C5}']
    { Property Accessors }
    function Get_Type_: WideString;
    function Get_Name: WideString;
    procedure Set_Type_(Value: WideString);
    procedure Set_Name(Value: WideString);
    { Methods & Properties }
    property Type_: WideString read Get_Type_ write Set_Type_;
    property Name: WideString read Get_Name write Set_Name;
  end;

{ Forward Decls }

  TXMLQueryClientConfigType = class;
  TXMLPrintersType = class;
  TXMLReportType = class;
  TXMLConnected_printersType = class;
  TXMLPrinterType = class;

{ TXMLQueryClientConfigType }

  TXMLQueryClientConfigType = class(TXMLNode, IXMLQueryClientConfigType)
  protected
    { IXMLQueryClientConfigType }
    function Get_Printers: IXMLPrintersType;
    function Get_Connected_printers: IXMLConnected_printersType;
  public
    procedure AfterConstruction; override;
  end;

{ TXMLPrintersType }

  TXMLPrintersType = class(TXMLNodeCollection, IXMLPrintersType)
  protected
    { IXMLPrintersType }
    function Get_Report(Index: Integer): IXMLReportType;
    function Add: IXMLReportType;
    function Insert(const Index: Integer): IXMLReportType;
  public
    procedure AfterConstruction; override;
  end;

{ TXMLReportType }

  TXMLReportType = class(TXMLNode, IXMLReportType)
  protected
    { IXMLReportType }
    function Get_Hashid: WideString;
    function Get_Printer: WideString;
    procedure Set_Hashid(Value: WideString);
    procedure Set_Printer(Value: WideString);
  end;

{ TXMLConnected_printersType }

  TXMLConnected_printersType = class(TXMLNodeCollection, IXMLConnected_printersType)
  protected
    { IXMLConnected_printersType }
    function Get_Printer(Index: Integer): IXMLPrinterType;
    function Add: IXMLPrinterType;
    function Insert(const Index: Integer): IXMLPrinterType;
  public
    procedure AfterConstruction; override;
  end;

{ TXMLPrinterType }

  TXMLPrinterType = class(TXMLNode, IXMLPrinterType)
  protected
    { IXMLPrinterType }
    function Get_Type_: WideString;
    function Get_Name: WideString;
    procedure Set_Type_(Value: WideString);
    procedure Set_Name(Value: WideString);
  end;

{ Global Functions }

function GetqueryClientConfig(Doc: IXMLDocument): IXMLQueryClientConfigType;
function LoadqueryClientConfig(const FileName: WideString): IXMLQueryClientConfigType;
function NewqueryClientConfig: IXMLQueryClientConfigType;

const
  TargetNamespace = '';

implementation

{ Global Functions }

function GetqueryClientConfig(Doc: IXMLDocument): IXMLQueryClientConfigType;
begin
  Result := Doc.GetDocBinding('queryClientConfig', TXMLQueryClientConfigType, TargetNamespace) as IXMLQueryClientConfigType;
end;

function LoadqueryClientConfig(const FileName: WideString): IXMLQueryClientConfigType;
begin
  Result := LoadXMLDocument(FileName).GetDocBinding('queryClientConfig', TXMLQueryClientConfigType, TargetNamespace) as IXMLQueryClientConfigType;
end;

function NewqueryClientConfig: IXMLQueryClientConfigType;
begin
  Result := NewXMLDocument.GetDocBinding('queryClientConfig', TXMLQueryClientConfigType, TargetNamespace) as IXMLQueryClientConfigType;
end;

{ TXMLQueryClientConfigType }

procedure TXMLQueryClientConfigType.AfterConstruction;
begin
  RegisterChildNode('printers', TXMLPrintersType);
  RegisterChildNode('connected_printers', TXMLConnected_printersType);
  inherited;
end;

function TXMLQueryClientConfigType.Get_Printers: IXMLPrintersType;
begin
  Result := ChildNodes['printers'] as IXMLPrintersType;
end;

function TXMLQueryClientConfigType.Get_Connected_printers: IXMLConnected_printersType;
begin
  Result := ChildNodes['connected_printers'] as IXMLConnected_printersType;
end;

{ TXMLPrintersType }

procedure TXMLPrintersType.AfterConstruction;
begin
  RegisterChildNode('report', TXMLReportType);
  ItemTag := 'report';
  ItemInterface := IXMLReportType;
  inherited;
end;

function TXMLPrintersType.Get_Report(Index: Integer): IXMLReportType;
begin
  Result := List[Index] as IXMLReportType;
end;

function TXMLPrintersType.Add: IXMLReportType;
begin
  Result := AddItem(-1) as IXMLReportType;
end;

function TXMLPrintersType.Insert(const Index: Integer): IXMLReportType;
begin
  Result := AddItem(Index) as IXMLReportType;
end;

{ TXMLReportType }

function TXMLReportType.Get_Hashid: WideString;
begin
  Result := AttributeNodes['hashid'].Text;
end;

procedure TXMLReportType.Set_Hashid(Value: WideString);
begin
  SetAttribute('hashid', Value);
end;

function TXMLReportType.Get_Printer: WideString;
begin
  Result := AttributeNodes['printer'].Text;
end;

procedure TXMLReportType.Set_Printer(Value: WideString);
begin
  SetAttribute('printer', Value);
end;

{ TXMLConnected_printersType }

procedure TXMLConnected_printersType.AfterConstruction;
begin
  RegisterChildNode('printer', TXMLPrinterType);
  ItemTag := 'printer';
  ItemInterface := IXMLPrinterType;
  inherited;
end;

function TXMLConnected_printersType.Get_Printer(Index: Integer): IXMLPrinterType;
begin
  Result := List[Index] as IXMLPrinterType;
end;

function TXMLConnected_printersType.Add: IXMLPrinterType;
begin
  Result := AddItem(-1) as IXMLPrinterType;
end;

function TXMLConnected_printersType.Insert(const Index: Integer): IXMLPrinterType;
begin
  Result := AddItem(Index) as IXMLPrinterType;
end;

{ TXMLPrinterType }

function TXMLPrinterType.Get_Type_: WideString;
begin
  Result := AttributeNodes['type'].Text;
end;

procedure TXMLPrinterType.Set_Type_(Value: WideString);
begin
  SetAttribute('type', Value);
end;

function TXMLPrinterType.Get_Name: WideString;
begin
  Result := AttributeNodes['name'].Text;
end;

procedure TXMLPrinterType.Set_Name(Value: WideString);
begin
  SetAttribute('name', Value);
end;

end.